<?php
		$total = ceil($count/C('PAGE_SIZE'));
		if($total > 1){
			$fristPage = $page-1 <= 0 ? 1 : $page-1;
			$lastPage = $page+1 > $total ? $page : $page+1;
?>
	<div class="dataTables_paginate paging_simple_numbers">
		<a class="paginate_button previous nextpage" aria-controls="DataTables_Table_0" data-dt-idx="1" tabindex="0">首页</a>
		<span>
<?php           if($total > 10){
						if(($page-6) > 0){
							$starts = ($page-5);
							$ends = ($page+5);
						}else{
							$starts = 1;
							$ends = 11;
						}
			            for($i=$starts; $i<=$ends; $i++){
						    if($i <= $total){
?>
				<a class="paginate_button nextpage <?php if($i==$page){ echo 'current';} ?>" aria-controls="DataTables_Table_0" data-dt-idx="{$i}" tabindex="0">{$i}</a>
<?php
					       }
                      }
         		 }else{
          			 for($i=1; $i<=$total; $i++){
?>
			<a class="paginate_button nextpage <?php if($i==$page){ echo 'current';} ?>" aria-controls="DataTables_Table_0" data-dt-idx="{$i}" tabindex="0">{$i}</a>
<?php              }

                }
?>
		</span>
		<a class="paginate_button previous nextpage" aria-controls="DataTables_Table_0" data-dt-idx="{$total}" tabindex="0">尾页</a>
	</div>	
<?php   }
?>
<script>
	$(document).ready(function(){
		$(".nextpage").on('click', function(){
			<?php if($param){ ?>
				var pageParam = {$param};
			<?php }else{ ?>
				var pageParam = {};
			<?php } ?>
				pageParam.page = $(this).attr('data-dt-idx');
				pageParam.ajax = 1;
			/**
			 * 异步请求数据
			 **/
			var load = layer.load(2); 
			$.get("__ACTION__", pageParam, function(data){
				layer.close(load);
				$("#ajaxDiv").html('').html(data);
			});
		});
	});
</script>